<template>
  <view>
    <!-- 微信公众号链接 -->
    <web-view :src="webViewUrl"></web-view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        webViewUrl: '',
        isShowCustomNavBar: true,
        nowPages:'',
        navbarData: {
          showCapsule: 0 //是否显示左上角图标   1表示显示    0表示不显示
        },
      }
    },
    onLoad(option) {
      let that = this;
      let uniLoginInfo = uni.getStorageSync('uniLoginInfo')
      that.webViewUrl = option.webViewUrl.indexOf('?') == -1 ? `${option.webViewUrl}?unionidID=${uniLoginInfo.unionId}` : `${option.webViewUrl}&unionidID=${uniLoginInfo.unionId}`;
      let pages = getCurrentPages();
      var currPage = pages[pages.length - 1]; //当前页面
      this.nowPages = currPage.route;
    },
    onShow() {
      getApp().cl_tracker.track('mini_program_view', {
            path:  this.nowPages,
            pageName: '微信公众号',
          })
    },
    // 转发分享
    onShareAppMessage(res) {
      let that = this;
      this.$EFSTracking.trackingAction('SHARE_CARD', res.from, {});
      let sharePath = 'pages/util/webview?webViewUrl=' + that.webViewUrl;
      let pageTitle = uni.getStorageSync('storeName');
      this.$commonSensors.sensorsPageShare()
      return this.$commonFunction.commonShare(res, pageTitle, sharePath)
    }
  }
</script>
<style lang="less" scoped>

</style>
